import pygame, sys, os


#reassignment/reset functions?


pygame.init()

#controls

k_quit = pygame.K_ESCAPE
k_pause = pygame.K_p

k_up = pygame.K_UP
k_down = pygame.K_DOWN
k_left = pygame.K_LEFT
k_right = pygame.K_RIGHT

k_action1 = pygame.K_SPACE
k_action2 = pygame.K_RETURN

k_backspace = pygame.K_BACKSPACE

controls = {
	k_quit: False,
	k_pause: False,
	k_up: False,
	k_down: False,
	k_left: False,
	k_right: False,
	k_action1: False,
	k_action2: False,
	"lmb": False,
	"rmb": False,
	'0': False,
	'1': False,
	'2': False,
	'3': False,
	'4': False,
	'5': False,
	'6': False,
	'7': False,
	'8': False,
	'9': False,
	k_backspace: False,
}

new_events = {
	k_quit: False,
	k_pause: False,
	k_up: False,
	k_down: False,
	k_left: False,
	k_right: False,
	k_action1: False,
	k_action2: False,
	"lmb": False,
	"rmb": False,
	'0': False,
	'1': False,
	'2': False,
	'3': False,
	'4': False,
	'5': False,
	'6': False,
	'7': False,
	'8': False,
	'9': False,
	k_backspace: False,
}

def number_key(k):
	key = (k - pygame.K_0) % (pygame.K_KP0 - pygame.K_0)
	if key < 0 or key > 9:
		return -1
	return str(key)
